package cn.ickck.law_paper_final.service.Impl;

import cn.ickck.law_paper_final.mapper.PaDAO;
import cn.ickck.law_paper_final.model.entity.Pa;
import cn.ickck.law_paper_final.service.PaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Author: ck
 * @Description:
 * @Date: Create in 13:07 2020/12/13
 */
@Service
public class PaServiceImpl implements PaService {
   @Autowired
   private PaDAO paDAO;
    @Override
    public void insert(Pa pa) {
        paDAO.insertSelective(pa);
    }


    @Override
    public void deleteById(Integer id) {
        paDAO.deleteByPrimaryKey(id);
    }

    @Override
    public void update(Pa pa) {
        paDAO.updateByPrimaryKeySelective(pa);
    }

    @Override
    public int count() {
        return paDAO.count();
    }


    @Override
    public List<Pa> selectByPage(int start, int end) {
        return paDAO.selectByPage(start,end);
    }

    @Override
    public List<Pa> selectByNameOrKey(String key) {
        return paDAO.selectByKeyOrName(key);
    }

    @Override
    public void deleteByKey(String key) {
        paDAO.deleteByKey(key);
    }
}
